Imports System.Data.SqlClient
Public Class Insumo ': Implements IBusquedaFiltrado

    Private CodInsumos As String
    Private Nombre As String
    Private Descripcion As String
    Private Estado As String
    Private UnidadMedida As String


    Public Property codigo() As String
        Get
            Return CodInsumos
        End Get
        Set(ByVal value As String)
            CodInsumos = value
        End Set
    End Property
    Public Property Nom() As String
        Get
            Return Nombre
        End Get
        Set(ByVal value As String)
            Nombre = value
        End Set
    End Property
    Public Property Descrip() As String
        Get
            Return Descripcion
        End Get
        Set(ByVal value As String)
            Descripcion = value
        End Set
    End Property
    Public Property Est() As String
        Get
            Return Estado
        End Get
        Set(ByVal value As String)
            Estado = value
        End Set
    End Property
    Public Property UniMed() As String
        Get
            Return UnidadMedida
        End Get
        Set(ByVal value As String)
            UnidadMedida = value
        End Set
    End Property



    Public Sub New()
        CodInsumos = ""
        Nombre = ""
        Descripcion = ""
        Estado = ""
        UnidadMedida = ""
    End Sub

    Public Function BuscarIns(ByVal cod As String, ByRef con As ConexionBD) As DataSet

        Dim sql As String = ""
        Dim adapter As SqlDataAdapter = Nothing
        Dim datos As DataSet = New DataSet()

        sql = String.Format("SELECT E.CODINSUMO, E.NOMBRE, N.CANTIDADACTUAL FROM INSUMOS E,STOCK N WHERE E.CODINSUMO=N.CODINSUMO AND N.CANTIDADACTUAL<= N.CANTMINIMA", cod)
        adapter = New SqlDataAdapter(sql, con.ConexionBase)
        adapter.Fill(datos, "insumos")


        Return datos
    End Function
End Class
